//
// Created by 21577 on 2025/3/4.
//
#include<stdio.h>
#include<math.h>

int main() {
    int n, a;
    while (scanf("%d %d", &n, &a) != EOF) {
        int S = 0, num, num1 = 0;
        for (int i = 0; i < n; i++) {
            num = a * pow(10, i);
            num1 += num;
            S += num1;
        }
        printf("%d\n", S);
    }
    return 0;
}